package com.cy.dao;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.cy.pojo.Picturepojo;
@Mapper
public interface Picturedao {
	
	@Select("select * from picture where pid=#{id}")
	Picturepojo selectRo(String id);
	
	@Select("select COUNT(*) from picture where pid=#{id}")
	int copicture(String id);
	
	@Insert("INSERT INTO picture (pid,size,url,position,link) "
			+ "VALUES (#{pid},#{size},#{url},#{position},#{link}) ")
	int insertpic(Picturepojo pic);
	
	@Update("UPDATE picture" + 
			"SET url=#{url}" + 
			"WHERE pid=#{pid};")
	int updatepic(Picturepojo pic);
	

}
